#region Copyright
/// <copyright>
/// Copyright (c) 2007 Ilia Shramko.
/// Released under the terms of the GNU General Public License.
/// </copyright>
#endregion

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Runtime.InteropServices;
using System.Text;

namespace Osh.Configuration
{
	public interface IModeElement : IConfigurationElement
	{
		string Name { get; set; }
		string Player { get; set; }
		string Shortcut { get; set; }
		KeyCollection Keys { get; }
	}

	[ClassInterface(ClassInterfaceType.None)]
	public class ModeElement : ConfigurationElement, IModeElement
	{
		public ModeElement()
		{
		}

		public ModeElement(string name)
		{
			this.Name = name;
		}

		[ConfigurationProperty("name", IsRequired = true, IsKey = true)]
		public string Name
		{
			get { return (string)this["name"]; }
			set { this["name"] = value; }
		}

		[ConfigurationProperty("player")]
		public string Player
		{
			get { return (string)this["player"]; }
			set { this["player"] = value; }
		}

		[ConfigurationProperty("shortcut")]
		public string Shortcut
		{
			get { return (string)this["shortcut"]; }
			set { this["shortcut"] = value; }
		}

		[ConfigurationProperty("keys", IsDefaultCollection = false)]
		public KeyCollection Keys
		{
			get { return (KeyCollection)base["keys"]; }

		}
	}

}
